var t = require;
var e = module;
var o = exports;
var n =
        (this && this.__extends) ||
        (function () {
            var t = function (e, o) {
                return (t =
                    Object.setPrototypeOf ||
                    ({__proto__: []} instanceof Array &&
                        function (t, e) {
                            t.__proto__ = e;
                        }) ||
                    function (t, e) {
                        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                    })(e, o);
            };
            return function (e, o) {
                function n() {
                    this.constructor = e;
                }
                t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
            };
        })(),
    r =
        (this && this.__decorate) ||
        function (t, e, o, n) {
            var r,
                a = arguments.length,
                i = a < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (r = t[s]) && (i = (a < 3 ? r(i) : a > 3 ? r(e, o, i) : r(e, o)) || i);
            return a > 3 && i && Object.defineProperty(e, o, i), i;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var a = t("Sounds"),
    i = t("Platforms"),
    s = cc._decorator,
    c = s.ccclass,
    l =
        (s.property,
        (function (t) {
            function e() {
                return (null !== t && t.apply(this, arguments)) || this;
            }
            return (
                n(e, t),
                (e.prototype.init = function () {
                    var t = this;
                    (this.area = this.node.getChildByName("area")),
                        (this.container = this.node.getChildByName("container")),
                        (this.black = this.container.getChildByName("black")),
                        (this._icons = this.container.getChildByName("icons")),
                        (this.icons = new Array()),
                        (this.lachu1 = this.container.getChildByName("lachu1")),
                        this.lachu1.on(cc.Node.EventType.TOUCH_END, function () {
                            a.Sounds.playFX("点击"), t.area.active ? t.hide() : t.show();
                        }),
                        this.area.on(cc.Node.EventType.TOUCH_END, function () {
                            a.Sounds.playFX("点击"), t.hide();
                        }),
                        (this.area.active = !1),
                        (this.black.active = !1),
                        (this.lachu1.active = !1),
                        (this.node.active = !0);
                }),
                (e.prototype.show = function () {
                    if (
                        ((this.area.active = !0),
                        (this.black.active = !0),
                        (this._icons.active = !0),
                        this.rule.侧拉9宫格)
                    ) {
                        (this.black.width = 330),
                            (this.black.height = this.rule.显示名字 ? 440 : 330),
                            (this._icons.x = -270);
                        for (var t = 0; t < 9; t++) {
                            (o = i.default.getSingleCPB(this.rule)) &&
                                (this._icons.addChild(o.node),
                                (o.node.x = (t % 3) * 105),
                                (o.node.y = Math.floor(t / 3) * -(this.rule.显示名字 ? 140 : 105)),
                                this.icons.push(o));
                        }
                    } else {
                        (this.black.width = 120),
                            (this.black.height = this.rule.显示名字 ? 575 : 540),
                            (this._icons.x = -60);
                        var e = this.rule.显示名字 ? 4 : 5;
                        for (t = 0; t < e; t++) {
                            var o;
                            (o = i.default.getSingleCPB(this.rule)) &&
                                (this._icons.addChild(o.node),
                                (o.node.y = t * -(this.rule.显示名字 ? 140 : 105)),
                                this.icons.push(o));
                        }
                    }
                    this.container.stopAllActions(),
                        this.container.runAction(
                            cc.moveTo(0.3, this.black.width, 0).easing(cc.easeCircleActionInOut())
                        );
                }),
                (e.prototype.hide = function () {
                    var t = this;
                    this.container.stopAllActions(),
                        this.container.runAction(
                            cc.sequence(
                                cc.moveTo(0.4, 0, 0).easing(cc.easeCircleActionInOut()),
                                cc.callFunc(function () {
                                    (t.area.active = !1), (t.black.active = !1), (t._icons.active = !1);
                                    for (var e = 0, o = t.icons; e < o.length; e++) {
                                        o[e].clear();
                                    }
                                    t.icons.length = 0;
                                })
                            )
                        );
                }),
                (e = r([c], e))
            );
        })(cc.Component));
o.default = l;
